//
//  CollectionVC.m
//  HappyRent
//
//  Created by CoderYee on 2017/3/31.
//  Copyright © 2017年 内圈科技. All rights reserved.
//

#import "CollectionVC.h"
#import "Home_CollectionViewCell.h"

@interface CollectionVC ()

@end

@implementation CollectionVC
-(void)configOwnViews{
    
    [super configOwnViews];
    [self.view setBackgroundColor:kBackgroundColor];
    [self.collectionView setFrame:CGRectMake(0, 0, kMainScreenWidth, KcontentViewHeight-49)];
    
    [self CollectionPullupHeaderRefresh:^{
        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            
            [self CollectionViewEndRefresh];
        });
    }];
}
-(void)registerCellClass{
    
    [super registerCellClass];
    [self.collectionView registerClass:[Home_CollectionViewCell class] forCellWithReuseIdentifier:[Home_CollectionViewCell cellIdentifier]];
    
}
#pragma mark   UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    
    return 13;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    Home_CollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:[Home_CollectionViewCell cellIdentifier] forIndexPath:indexPath];
    return cell;
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
    
    return UIEdgeInsetsMake(0, 5, 0, 5);
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    return CGSizeMake(kMainScreenWidth-10,kMainScreenWidth*0.5+30 );
}
-(void)configTableCellindexPath:(NSIndexPath*)indexPath{
    
    
}


@end
